<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>指尖改变世界 - 科技始终来源于人性</title><meta name="keywords" content="沙屿沫个人博客,沙屿沫,shayvmo,php"><meta name="author" content="沙屿沫"><meta name="copyright" content="沙屿沫"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="科技始终来源于人性">
<meta property="og:type" content="website">
<meta property="og:title" content="指尖改变世界">
<meta property="og:url" content="http://blog.shayvmo.cn/page/4/index.html">
<meta property="og:site_name" content="指尖改变世界">
<meta property="og:description" content="科技始终来源于人性">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://blog.shayvmo.cn/images/avatar.jpg">
<meta property="article:author" content="沙屿沫">
<meta property="article:tag" content="沙屿沫个人博客,沙屿沫,shayvmo,php">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://blog.shayvmo.cn/images/avatar.jpg"><link rel="shortcut icon" href="/images/avatar.jpg"><link rel="canonical" href="http://blog.shayvmo.cn/page/4/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?5e4d1e8fcc524b4e732ea58fa9fa15f0";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '指尖改变世界',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2023-06-05 17:19:25'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src= "" data-lazy-src="/images/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">74</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">42</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">15</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('/images/bg/kobe.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">指尖改变世界</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">指尖改变世界</h1><div id="site-subtitle"><span id="subtitle"></span></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/12/23/explain-sql/" title="使用 Explain 命令分析SQL语句">     <img class="post_bg" src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="使用 Explain 命令分析SQL语句"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/12/23/explain-sql/" title="使用 Explain 命令分析SQL语句">使用 Explain 命令分析SQL语句</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-12-23T07:32:42.000Z" title="发表于 2020-12-23 15:32:42">2020-12-23</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/MySQL/">MySQL</a></span></div><div class="content">Explain 命令2020年12月23日
参考地址
日常开发必备操作1、日常开发，mysql数据库的慢日志先打开，并设置查询时间为1秒。
2、开启 binlog
【建议】在开发阶段，预先分析一下查询语句是否使用索引，查询字段是否为 * 等等
Explain 比较重要的字段
type
select_type 
key
rows
filtered

select_type
SIMPLE 

(简单SELECT，不使用UNION或子查询等)


PRIMARY

(子查询中最外层查询，查询中若包含任何复杂的子部分，最外层的select被标记为PRIMARY)


UNION 

(UNION中的第二个或后面的SELECT语句)


DEPENDENT UNION

(UNION中的第二个或后面的SELECT语句，取决于外面的查询)


UNION RESULT

(UNION的结果，union语句中第二个select开始后面所有select)


SUBQUERY

(子查询中的第一个SELECT，结果不依赖于外部查询)


DEPENDENT SUBQUERY

(子查询中的第一个SEL ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/12/18/java-generic/" title="Java 泛型">     <img class="post_bg" src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java 泛型"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/12/18/java-generic/" title="Java 泛型">Java 泛型</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-12-18T09:04:52.000Z" title="发表于 2020-12-18 17:04:52">2020-12-18</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Java/">Java</a></span></div><div class="content">概念Java 泛型是 JavaSE 5.0 新增加的特性，该特性允许在编译时检测到非法的类型，本质是参数化类型。
泛型程序设计 意味着编写的代码可以被很多不同类型的对象重用。
Java 泛型是伪泛型，因为在Java编译期间，会把所有的泛型信息擦除掉，这也称为类型擦除。更多关于类型擦除的问题，可以查看这篇文章 《Java泛型类型擦除以及类型擦除带来的问题》
package com.demo11;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;import java.util.ArrayList;import java.util.List;public class genericDemo &#123;    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException &#123;        Li ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/10/26/remember-me-login/" title="网页登录《记住我》功能实现原理">     <img class="post_bg" src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="网页登录《记住我》功能实现原理"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/10/26/remember-me-login/" title="网页登录《记住我》功能实现原理">网页登录《记住我》功能实现原理</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-10-26T03:04:01.000Z" title="发表于 2020-10-26 11:04:01">2020-10-26</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%85%B6%E4%BB%96/">其他</a></span></div><div class="content">通常，在使用web系统时，无论是MVC，还是前后端分离的方式，都不可避免会使用到登录的功能。
为了提高用户体验，简化用户登录的操作，我们会加入一个《记住我》的功能，记录当前用户的登录状态，当下次再次进入系统时，无需进行登录。
那么这个功能的原理究竟是怎样的？
我们一起来理一下。
首先，这个功能的使用场景是登录，载体是浏览器，所以我们可以利用cookie的方式去处理。
流程1、登录 -&gt;
2、服务器进行校验 -&gt; 
3、保存token到数据库，返回前端浏览器登录token -&gt; 
4、前端保存token到cookie -&gt; 
5、下次请求时，后端读取cookie 中的token, 并校验，通过即可快速登录
问题1、浏览器禁用cookie怎么办？
在基于cookie的前提下，禁用了cookie则无法正常使用功能。 当然session有另外的解决方式，这个另说啦。
</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/09/29/yii-collection/" title="Yii 实战合集记录">     <img class="post_bg" src= "" data-lazy-src="/images/yii.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Yii 实战合集记录"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/09/29/yii-collection/" title="Yii 实战合集记录">Yii 实战合集记录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-09-29T01:51:25.000Z" title="发表于 2020-09-29 09:51:25">2020-09-29</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/PHP/">PHP</a></span></div><div class="content">1、Yii 设置hostInfo生成绝对的url
源链接
Yii 中，可以设置请求地址中的hostInfo 来达到生成绝对的Url
Yii::app()-&gt;request-&gt;setHostInfo(&#x27;http://127.0.0.1&#x27;);echo Yii::$app-&gt;request-&gt;hostInfo;

同样，也可以在 config目录下，进行配置项的设置
&#x27;components&#x27; =&gt; [    &#x27;request&#x27; =&gt; [        &#x27;hostInfo&#x27; =&gt; &#x27;&#x27;,        &#x27;baseUrl&#x27; =&gt; &#x27;&#x27;,    ]]


2、生成环境开启 SCHEMA CACHE缓存
# 对应 db 配置项enableSchemaCache=true

在没有开启schema缓存的情况下，Yii框架会在每次查表时，执行以下语句，可能会造成数据库响应变慢，甚至直接拖垮数据库。
SELECT     ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/09/29/hexo-collection/" title="Hexo 问题合集">     <img class="post_bg" src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo 问题合集"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/09/29/hexo-collection/" title="Hexo 问题合集">Hexo 问题合集</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-09-29T01:48:26.000Z" title="发表于 2020-09-29 09:48:26">2020-09-29</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Hexo/">Hexo</a></span></div><div class="content">【问题】1、hexo: command not found
解决：重新全局安装 hexo-cli ，执行命令 npm install hexo-cli -g
2、node 配置国内源
解决：执行命令 npm config set registry http://registry.npm.taobao.org
</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/09/11/mysql-copy/" title="MySQL主从复制部署以及遇到的问题">     <img class="post_bg" src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="MySQL主从复制部署以及遇到的问题"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/09/11/mysql-copy/" title="MySQL主从复制部署以及遇到的问题">MySQL主从复制部署以及遇到的问题</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-09-11T09:11:14.000Z" title="发表于 2020-09-11 17:11:14">2020-09-11</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/MySQL/">MySQL</a></span></div><div class="content">MySQL主从复制，就是利用MySQL本身的复制特性实现
达到互联网常用的数据库配置，如：1主+1从；1主+N从等架构
一、复制解决的根本问题让一台服务器的数据与其他服务器保持同步。
二、支持两种复制方式基于行的复制（5.1版本引入）
基于语句的复制（也称为逻辑复制）
两种方式都是通过主库上记录二进制日志，在备库重放日志的方式来实现异步的数据复制。
三、复制解决的问题1、数据分布
2、负载均衡
3、备份
4、高可用和故障切换
5、MySQL升级测试
四、复制如何工作复制通常有三个步骤：
1、在主库上把数据更改记录记录到二进制日志中（这些记录被称为二进制日志事件）
2、备库将主库上的日志复制到自己的中继日志（relay log）中
3、备库读取中继日志中的事件，将其重放到备库数据之上
五、配置复制下面列出针对新安装的主库和备库，可以从以下几步进行配置：
1、在每台服务器创建复制账号
2、配置主库和备库
3、通知备库连接到主库并从主库复制数据
1、创建复制账号注：主库和备库都执行该操作。
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.*  ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/08/13/ubuntu-docker/" title="ubuntu20.04 安装docker">     <img class="post_bg" src= "" data-lazy-src="/images/ubuntu.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="ubuntu20.04 安装docker"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/08/13/ubuntu-docker/" title="ubuntu20.04 安装docker">ubuntu20.04 安装docker</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-08-13T07:55:52.000Z" title="发表于 2020-08-13 15:55:52">2020-08-13</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Linux/">Linux</a></span></div><div class="content">Ubuntu20.04 安装 docker
来源：清华大学开源软件镜像站
【具体步骤】docker官方安装指引 
1、之前有安装过 docker ， 先删除(新安装的20.04版本没有安装，其他版本可能会默认安装了)sudo apt-get remove docker docker-engine docker.io containerd runc
2、安装依赖sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
3、信任 docker 的 GPG 公钥curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4、添加软件仓库
sudo add-apt-repository \   &quot;deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \   $( ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/08/13/ubuntu-todo/" title="新安装完 ubuntu 20.04 ， 我做了这些操作!">     <img class="post_bg" src= "" data-lazy-src="/images/ubuntu.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="新安装完 ubuntu 20.04 ， 我做了这些操作!"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/08/13/ubuntu-todo/" title="新安装完 ubuntu 20.04 ， 我做了这些操作!">新安装完 ubuntu 20.04 ， 我做了这些操作!</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-08-13T07:47:42.000Z" title="发表于 2020-08-13 15:47:42">2020-08-13</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Linux/">Linux</a></span></div><div class="content">1、更新软件源上篇已经说过这个操作，飞机直达
2、增加中文输入法ubuntu 20.04 看到已经可以在 setting -&gt; region &amp; langague 相应添加中文智能拼音输入法，这里我就没有安装其他输入法
3、安装 VIMsudo apt-get install vim
4、安装 docker另一篇有介绍，直达
</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/08/13/ubuntu-update-source/" title="ubuntu20.04 更新软件源">     <img class="post_bg" src= "" data-lazy-src="/images/ubuntu.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="ubuntu20.04 更新软件源"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/08/13/ubuntu-update-source/" title="ubuntu20.04 更新软件源">ubuntu20.04 更新软件源</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-08-13T07:19:01.000Z" title="发表于 2020-08-13 15:19:01">2020-08-13</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Linux/">Linux</a></span></div><div class="content">众所周知，我们的网络都是有沃尔（wall）的。
在访问一些国外的网站，软件源等等，速度都会比国内的网站要慢。
但是我们可以更新软件源，或镜像源达到加速的目的。
下面，演示一下更新 Ubuntu 20.04 的软件源到清华大学的软件源。
【具体步骤】1、清华大学软件源清华软件源
左边栏相应地选择 ubuntu ,这里我们可以看到清华大学已经更新了Ubuntu 软件源到 20.04 版本

2、进入ubuntu,ctrl + alt + t 呼出终端# 备份原先的官方源cp /etc/apt/sources.list /etc/apt/sources.list.backup

把上图中的源列表, 覆盖到 /etc/apt/sources.list 
执行更新源命令 apt-get update 即可。
</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/06/12/php7/" title="PHP7 新特性与变更">     <img class="post_bg" src= "" data-lazy-src="/images/php.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="PHP7 新特性与变更"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/06/12/php7/" title="PHP7 新特性与变更">PHP7 新特性与变更</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-06-12T06:42:57.000Z" title="发表于 2020-06-12 14:42:57">2020-06-12</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/PHP/">PHP</a></span></div><div class="content">官方文档： 从PHP 5.6.x 移植到 PHP 7.0.x
PHP官方文档上面说到, PHP7 相对于 PHP5.6 来说，是一个大版本的改变。
现在我们整理一下可能会影响到日常开发的点（注：实际变更涉及到的点不仅限于下述几点）。
【不向后兼容变更】异常处理和错误的更改在PHP 7中，很多致命错误以及可恢复的致命错误，都被转换为异常来处理了。 这些异常继承自Error类，此类实现了Throwable接口 （所有异常都实现了这个基础接口）。
这也意味着，当发生错误的时候，以前代码中的一些错误处理的代码将无法被触发。 因为在PHP 7版本中，已经使用抛出异常的错误处理机制了。 （如果代码中没有捕获Error异常，那么会引发致命错误）。
关于间接使用变量、属性和方法的变化对变量、属性和方法的间接调用现在将严格遵循从左到右的顺序来解析
使用了旧的从右到左的解析顺序的代码必须被重写，明确的使用大括号来表明顺序（参见示例 PHP5 的写法）。 这样使得代码既保持了与PHP 7.x的前向兼容性，又保持了与PHP 5.x的后向兼容性。
示例：
$a = &#x27;b&#x27;;$b = [    ...</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/page/3/#content-inner"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/3/#content-inner">3</a><span class="page-number current">4</span><a class="page-number" href="/page/5/#content-inner">5</a><span class="space">&hellip;</span><a class="page-number" href="/page/8/#content-inner">8</a><a class="extend next" rel="next" href="/page/5/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src= "" data-lazy-src="/images/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">沙屿沫</div><div class="author-info__description">科技始终来源于人性</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">74</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">42</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">15</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://gitee.com/shayvmo"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">生活就像海洋，只有意志坚强的人才能到达彼岸。</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2023/06/05/webman-route-annotation/" title="webman 框架 注解路由插件"><img src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="webman 框架 注解路由插件"/></a><div class="content"><a class="title" href="/2023/06/05/webman-route-annotation/" title="webman 框架 注解路由插件">webman 框架 注解路由插件</a><time datetime="2023-06-05T07:04:07.000Z" title="发表于 2023-06-05 15:04:07">2023-06-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/05/29/nginx-reload-not-effect/" title="windows服务器重载nginx配置无效"><img src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="windows服务器重载nginx配置无效"/></a><div class="content"><a class="title" href="/2023/05/29/nginx-reload-not-effect/" title="windows服务器重载nginx配置无效">windows服务器重载nginx配置无效</a><time datetime="2023-05-29T08:03:45.000Z" title="发表于 2023-05-29 16:03:45">2023-05-29</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/05/24/php-aes/" title="前后端接口传输AES加密"><img src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="前后端接口传输AES加密"/></a><div class="content"><a class="title" href="/2023/05/24/php-aes/" title="前后端接口传输AES加密">前后端接口传输AES加密</a><time datetime="2023-05-24T07:00:39.000Z" title="发表于 2023-05-24 15:00:39">2023-05-24</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/08/16/yar-demo/" title="Yar拓展，实现PHP的RPC服务"><img src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Yar拓展，实现PHP的RPC服务"/></a><div class="content"><a class="title" href="/2022/08/16/yar-demo/" title="Yar拓展，实现PHP的RPC服务">Yar拓展，实现PHP的RPC服务</a><time datetime="2022-08-16T09:30:43.000Z" title="发表于 2022-08-16 17:30:43">2022-08-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/08/15/my-online-log/" title="线上日志系统"><img src= "" data-lazy-src="/images/code.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="线上日志系统"/></a><div class="content"><a class="title" href="/2022/08/15/my-online-log/" title="线上日志系统">线上日志系统</a><time datetime="2022-08-15T09:03:01.000Z" title="发表于 2022-08-15 17:03:01">2022-08-15</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            <a class="card-more-btn" href="/categories/" title="查看更多">
    <i class="fas fa-angle-right"></i></a>
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Go/"><span class="card-category-list-name">Go</span><span class="card-category-list-count">4</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Hexo/"><span class="card-category-list-name">Hexo</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Java/"><span class="card-category-list-name">Java</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Linux/"><span class="card-category-list-name">Linux</span><span class="card-category-list-count">9</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Memcached/"><span class="card-category-list-name">Memcached</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/MySQL/"><span class="card-category-list-name">MySQL</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/PHP/"><span class="card-category-list-name">PHP</span><span class="card-category-list-count">23</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Redis/"><span class="card-category-list-name">Redis</span><span class="card-category-list-count">1</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/AES/" style="font-size: 1.1em; color: #999">AES</a> <a href="/tags/Apache/" style="font-size: 1.1em; color: #999">Apache</a> <a href="/tags/Curl/" style="font-size: 1.1em; color: #999">Curl</a> <a href="/tags/Go/" style="font-size: 1.37em; color: #99a4b2">Go</a> <a href="/tags/Hexo/" style="font-size: 1.37em; color: #99a4b2">Hexo</a> <a href="/tags/Laravel/" style="font-size: 1.1em; color: #999">Laravel</a> <a href="/tags/Linux/" style="font-size: 1.1em; color: #999">Linux</a> <a href="/tags/MD5/" style="font-size: 1.1em; color: #999">MD5</a> <a href="/tags/MySQL/" style="font-size: 1.37em; color: #99a4b2">MySQL</a> <a href="/tags/Nginx/" style="font-size: 1.23em; color: #999ea6">Nginx</a> <a href="/tags/PHP/" style="font-size: 1.5em; color: #99a9bf">PHP</a> <a href="/tags/Paypal/" style="font-size: 1.1em; color: #999">Paypal</a> <a href="/tags/PhpStorm/" style="font-size: 1.1em; color: #999">PhpStorm</a> <a href="/tags/Python/" style="font-size: 1.1em; color: #999">Python</a> <a href="/tags/RESTfulAPI/" style="font-size: 1.1em; color: #999">RESTfulAPI</a> <a href="/tags/RPC/" style="font-size: 1.1em; color: #999">RPC</a> <a href="/tags/Redis/" style="font-size: 1.1em; color: #999">Redis</a> <a href="/tags/SVN/" style="font-size: 1.1em; color: #999">SVN</a> <a href="/tags/Ubuntu/" style="font-size: 1.37em; color: #99a4b2">Ubuntu</a> <a href="/tags/Vagrant/" style="font-size: 1.23em; color: #999ea6">Vagrant</a> <a href="/tags/Websocket/" style="font-size: 1.1em; color: #999">Websocket</a> <a href="/tags/Yii/" style="font-size: 1.1em; color: #999">Yii</a> <a href="/tags/composer/" style="font-size: 1.1em; color: #999">composer</a> <a href="/tags/element/" style="font-size: 1.23em; color: #999ea6">element</a> <a href="/tags/git/" style="font-size: 1.1em; color: #999">git</a> <a href="/tags/jquery/" style="font-size: 1.1em; color: #999">jquery</a> <a href="/tags/memcached/" style="font-size: 1.1em; color: #999">memcached</a> <a href="/tags/postman/" style="font-size: 1.1em; color: #999">postman</a> <a href="/tags/sitemap/" style="font-size: 1.1em; color: #999">sitemap</a> <a href="/tags/thinkphp6/" style="font-size: 1.1em; color: #999">thinkphp6</a> <a href="/tags/vue/" style="font-size: 1.1em; color: #999">vue</a> <a href="/tags/webhooks/" style="font-size: 1.1em; color: #999">webhooks</a> <a href="/tags/webman/" style="font-size: 1.1em; color: #999">webman</a> <a href="/tags/%E5%85%AC%E4%BC%97%E5%8F%B7%E8%B0%83%E8%AF%95%E5%99%A8/" style="font-size: 1.1em; color: #999">公众号调试器</a> <a href="/tags/%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F/" style="font-size: 1.1em; color: #999">冒泡排序</a> <a href="/tags/%E5%8D%9A%E5%AE%A2%E8%BF%81%E7%A7%BB/" style="font-size: 1.1em; color: #999">博客迁移</a> <a href="/tags/%E5%9B%BE%E7%89%87%E8%BD%ACbase64/" style="font-size: 1.1em; color: #999">图片转base64</a> <a href="/tags/%E5%B7%A5%E5%85%B7/" style="font-size: 1.1em; color: #999">工具</a> <a href="/tags/%E5%B9%82%E7%AD%89/" style="font-size: 1.1em; color: #999">幂等</a> <a href="/tags/%E6%B3%9B%E5%9E%8B/" style="font-size: 1.1em; color: #999">泛型</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/archives/" title="查看更多">
    <i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/06/"><span class="card-archive-list-date">六月 2023</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/05/"><span class="card-archive-list-date">五月 2023</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/08/"><span class="card-archive-list-date">八月 2022</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/06/"><span class="card-archive-list-date">六月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/05/"><span class="card-archive-list-date">五月 2022</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/01/"><span class="card-archive-list-date">一月 2022</span><span class="card-archive-list-count">6</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/09/"><span class="card-archive-list-date">九月 2021</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/08/"><span class="card-archive-list-date">八月 2021</span><span class="card-archive-list-count">1</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">74</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2019-08-27T16:00:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">30.9k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2023-06-05T09:19:25.031Z"></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('/images/bg/kobe.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2023 By 沙屿沫</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a href="http://www.beian.miit.gov.cn/" target="_blank" rel="noopener"><img class="icp-icon" src= "" data-lazy-src="/images/icp.png"><span>粤ICP备18133330号</span></a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>function subtitleType () {
  if (true) { 
    var typed = new Typed("#subtitle", {
      strings: "生活就像海洋，只有意志坚强的人才能到达彼岸".split(","),
      startDelay: 300,
      typeSpeed: 150,
      loop: true,
      backSpeed: 50
    })
  } else {
    document.getElementById("subtitle").innerHTML = '生'
  }
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}</script></div><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="false" data-click="false"></script><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js" data-mobile="false" data-text="富强,民主,文明,和谐,自由,平等,公正,法治,爱国,敬业,诚信,友善" data-fontsize="15px" data-random="false" async="async"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>